package com.xiliu.server.modules.basicdata.service.impl;

import java.util.List;
import java.util.Arrays;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xiliu.server.modules.basicdata.entity.XlHousePic;
import com.xiliu.server.modules.basicdata.mapper.XlHousePicMapper;
import com.xiliu.server.modules.basicdata.service.IXlHousePicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 房源图片表Service业务层处理
 * 
 * @author xiliu
 * @date 2022-11-14
 */
@Service
public class XlHousePicServiceImpl extends ServiceImpl<XlHousePicMapper, XlHousePic> implements IXlHousePicService {
    @Autowired
    private XlHousePicMapper xlHousePicMapper;

    /**
     * 查询房源图片表
     * @param picId 房源图片表主键
     * @return 房源图片表
     */
    @Override
    public XlHousePic selectXlHousePicByPicId(Long picId) {
        return xlHousePicMapper.selectXlHousePicByPicId(picId);
    }

    /**
     * 查询房源图片表列表
     * @param xlHousePic 房源图片表
     * @return 房源图片表
     */
    @Override
    public List<XlHousePic> selectXlHousePicList(XlHousePic xlHousePic) {
        return xlHousePicMapper.selectXlHousePicList(xlHousePic);
    }

    /**
     * 新增房源图片表
     * @param xlHousePic 房源图片表
     * @return 结果
     */
    @Override
    public boolean create(XlHousePic xlHousePic) {
        return save(xlHousePic);
    }

    /**
     * 修改房源图片表
     * @param xlHousePic 房源图片表
     * @return 结果
     */
    @Override
    public boolean update(XlHousePic xlHousePic) {
        return updateById(xlHousePic);
    }

    /**
     * 批量删除房源图片表
     * @param picIds 需要删除的房源图片表主键
     * @return 结果
     */
    @Override
    public int deleteXlHousePicByPicIds(Long[] picIds) {
        return xlHousePicMapper.deleteBatchIds(Arrays.asList(picIds));
    }

    /**
     * 删除房源图片表信息
     * @param picId 房源图片表主键
     * @return 结果
     */
    @Override
    public int deleteXlHousePicByPicId(Long picId) {
        return xlHousePicMapper.deleteById(picId);
    }
}
